<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>通达OA任意文件上传/文件包含RCE漏洞分析 | Zeo's Security Lab</title><meta name="author" content="Zeo"><meta name="copyright" content="Zeo"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><meta name="description" content="通达OA任意文件上传&#x2F;文件包含RCE漏洞分析 0x01 前提 0x01 漏洞介绍 0x02 漏洞分析  首先下载安装 绕过身份验证文件上传部分 变量传递问题 文件包含部分    0x01 前提关于这个漏洞的利用方式： ​ 利用方式大致有两种：  包含日志文件。 绕过身份验证文件上传然后在文件包含。  下面主要分析第二种 0x01 漏洞介绍_通达OA_系统代表了协同OA的先进理念,16">
<meta property="og:type" content="article">
<meta property="og:title" content="通达OA任意文件上传&#x2F;文件包含RCE漏洞分析">
<meta property="og:url" content="https://godzeo.github.io/2020/03/30/%E9%80%9A%E8%BE%BEOA%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0!%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%ABRCE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="Zeo&#39;s Security Lab">
<meta property="og:description" content="通达OA任意文件上传&#x2F;文件包含RCE漏洞分析 0x01 前提 0x01 漏洞介绍 0x02 漏洞分析  首先下载安装 绕过身份验证文件上传部分 变量传递问题 文件包含部分    0x01 前提关于这个漏洞的利用方式： ​ 利用方式大致有两种：  包含日志文件。 绕过身份验证文件上传然后在文件包含。  下面主要分析第二种 0x01 漏洞介绍_通达OA_系统代表了协同OA的先进理念,16">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225559.webp">
<meta property="article:published_time" content="2020-03-30T02:06:34.000Z">
<meta property="article:modified_time" content="2022-11-28T12:25:22.943Z">
<meta property="article:author" content="Zeo">
<meta property="article:tag" content="代码审计">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225559.webp"><link rel="shortcut icon" href="/img/WX20211124-162855.png"><link rel="canonical" href="https://godzeo.github.io/2020/03/30/%E9%80%9A%E8%BE%BEOA%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0!%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%ABRCE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '通达OA任意文件上传/文件包含RCE漏洞分析',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-11-28 20:25:22'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', 'ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="Zeo's Security Lab" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231013354.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">125</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">46</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225559.webp')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Zeo's Security Lab</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">通达OA任意文件上传/文件包含RCE漏洞分析</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-03-30T02:06:34.000Z" title="发表于 2020-03-30 10:06:34">2020-03-30</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-11-28T12:25:22.943Z" title="更新于 2022-11-28 20:25:22">2022-11-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/WEB-%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0%E5%92%8C%E5%88%86%E6%9E%90/">WEB 漏洞复现和分析</a></span></div><div class="meta-secondline"></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><span id="more"></span>

<h3 id="通达OA任意文件上传-x2F-文件包含RCE漏洞分析"><a href="#通达OA任意文件上传-x2F-文件包含RCE漏洞分析" class="headerlink" title="通达OA任意文件上传&#x2F;文件包含RCE漏洞分析"></a>通达OA任意文件上传&#x2F;文件包含RCE漏洞分析</h3><ul>
<li><a href="#0x01__4">0x01 前提</a></li>
<li><a href="#0x01__19">0x01 漏洞介绍</a></li>
<li><a href="#0x02__40">0x02 漏洞分析</a></li>
<li><ul>
<li><a href="#_53">首先下载安装</a></li>
<li><a href="#_63">绕过身份验证文件上传部分</a></li>
<li><a href="#_356">变量传递问题</a></li>
<li><a href="#_484">文件包含部分</a></li>
</ul>
</li>
</ul>
<h1 id="0x01-前提"><a href="#0x01-前提" class="headerlink" title="0x01 前提"></a>0x01 前提</h1><p>关于这个漏洞的利用方式：</p>
<p>​</p>
<p>利用方式大致有两种：</p>
<ol>
<li>包含日志文件。</li>
<li>绕过身份验证文件上传然后在文件包含。</li>
</ol>
<p>下面主要分析第二种</p>
<h1 id="0x01-漏洞介绍"><a href="#0x01-漏洞介绍" class="headerlink" title="0x01 漏洞介绍"></a>0x01 漏洞介绍</h1><p>_通达OA_系统代表了协同OA的先进理念,16年研发铸就成熟OA产品,协同OA软件行业唯一央企团队研发,多次摘取国内OA软件金奖,拥有2万多家正式用户,8万多家免费版用户,超过…</p>
<p>主要危害：</p>
<p>攻击者可以在为登陆或者说，无任何条件触发漏洞，上传图片木马文件，请求进行文件包含最终可达成远程命令执行</p>
<p>影响版本：</p>
<ul>
<li>V11版</li>
<li>2017版</li>
<li>2016版</li>
<li>2015版</li>
<li>2013版</li>
<li>2013增强版</li>
</ul>
<h1 id="0x02-漏洞分析"><a href="#0x02-漏洞分析" class="headerlink" title="0x02 漏洞分析"></a>0x02 漏洞分析</h1><p>我用的官网下载的V11.3</p>
<p>利用方式大致有两种：</p>
<ol>
<li>包含日志文件。</li>
<li>绕过身份验证文件上传然后在文件包含。</li>
</ol>
<p>下面我主要分析饶过权限上传，然后文件包含的方式：</p>
<h2 id="首先下载安装"><a href="#首先下载安装" class="headerlink" title="首先下载安装"></a>首先下载安装</h2><p>打开源码一看，都加密了，使用zend进行了加密。</p>
<p>所以先要进行解密，百度即可。</p>
<p><img src="https://img-blog.csdnimg.cn/20200330094732543.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h2 id="绕过身份验证文件上传部分"><a href="#绕过身份验证文件上传部分" class="headerlink" title="绕过身份验证文件上传部分"></a>绕过身份验证文件上传部分</h2><p>存在漏洞的上传功能文件为 webroot\ispirit\im\upload.php</p>
<p>解密后的源码</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;?php</span></span><br><span class="line"></span><br><span class="line"><span class="title function_ invoke__">set_time_limit</span>(<span class="number">0</span>);</span><br><span class="line"><span class="variable">$P</span> = <span class="variable">$_POST</span>[<span class="string">&#x27;P&#x27;</span>];</span><br><span class="line"><span class="keyword">if</span> (<span class="keyword">isset</span>(<span class="variable">$P</span>) || <span class="variable">$P</span> != <span class="string">&#x27;&#x27;</span>) &#123;</span><br><span class="line">    <span class="title function_ invoke__">ob_start</span>();</span><br><span class="line">    <span class="keyword">include_once</span> <span class="string">&#x27;inc/session.php&#x27;</span>;</span><br><span class="line">    <span class="title function_ invoke__">session_id</span>(<span class="variable">$P</span>);</span><br><span class="line">    <span class="title function_ invoke__">session_start</span>();</span><br><span class="line">    <span class="title function_ invoke__">session_write_close</span>();</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;</span><br><span class="line">    <span class="keyword">include_once</span> <span class="string">&#x27;./auth.php&#x27;</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">include_once</span> <span class="string">&#x27;inc/utility_file.php&#x27;</span>;</span><br><span class="line"><span class="keyword">include_once</span> <span class="string">&#x27;inc/utility_msg.php&#x27;</span>;</span><br><span class="line"><span class="keyword">include_once</span> <span class="string">&#x27;mobile/inc/funcs.php&#x27;</span>;</span><br><span class="line"><span class="title function_ invoke__">ob_end_clean</span>();</span><br><span class="line"><span class="variable">$TYPE</span> = <span class="variable">$_POST</span>[<span class="string">&#x27;TYPE&#x27;</span>];</span><br><span class="line"><span class="variable">$DEST_UID</span> = <span class="variable">$_POST</span>[<span class="string">&#x27;DEST_UID&#x27;</span>];</span><br><span class="line"><span class="variable">$dataBack</span> = <span class="keyword">array</span>();</span><br><span class="line"><span class="keyword">if</span> (<span class="variable">$DEST_UID</span> != <span class="string">&#x27;&#x27;</span> &amp;&amp; !<span class="title function_ invoke__">td_verify_ids</span>(<span class="variable">$ids</span>)) &#123;</span><br><span class="line">    <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">0</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;½ÓÊÕ·½IDÎÞÐ§&#x27;</span>));</span><br><span class="line">    <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">    <span class="keyword">exit</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (<span class="title function_ invoke__">strpos</span>(<span class="variable">$DEST_UID</span>, <span class="string">&#x27;,&#x27;</span>) !== <span class="literal">false</span>) &#123;</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;</span><br><span class="line">    <span class="variable">$DEST_UID</span> = <span class="title function_ invoke__">intval</span>(<span class="variable">$DEST_UID</span>);</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (<span class="variable">$DEST_UID</span> == <span class="number">0</span>) &#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$UPLOAD_MODE</span> != <span class="number">2</span>) &#123;</span><br><span class="line">        <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">0</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;½ÓÊÕ·½IDÎÞÐ§&#x27;</span>));</span><br><span class="line">        <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">        <span class="keyword">exit</span>;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="variable">$MODULE</span> = <span class="string">&#x27;im&#x27;</span>;</span><br><span class="line"><span class="keyword">if</span> (<span class="number">1</span> &lt;= <span class="title function_ invoke__">count</span>(<span class="variable">$_FILES</span>)) &#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$UPLOAD_MODE</span> == <span class="string">&#x27;1&#x27;</span>) &#123;</span><br><span class="line">        <span class="keyword">if</span> (<span class="title function_ invoke__">strlen</span>(<span class="title function_ invoke__">urldecode</span>(<span class="variable">$_FILES</span>[<span class="string">&#x27;ATTACHMENT&#x27;</span>][<span class="string">&#x27;name&#x27;</span>])) != <span class="title function_ invoke__">strlen</span>(<span class="variable">$_FILES</span>[<span class="string">&#x27;ATTACHMENT&#x27;</span>][<span class="string">&#x27;name&#x27;</span>])) &#123;</span><br><span class="line">            <span class="variable">$_FILES</span>[<span class="string">&#x27;ATTACHMENT&#x27;</span>][<span class="string">&#x27;name&#x27;</span>] = <span class="title function_ invoke__">urldecode</span>(<span class="variable">$_FILES</span>[<span class="string">&#x27;ATTACHMENT&#x27;</span>][<span class="string">&#x27;name&#x27;</span>]);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="variable">$ATTACHMENTS</span> = <span class="title function_ invoke__">upload</span>(<span class="string">&#x27;ATTACHMENT&#x27;</span>, <span class="variable">$MODULE</span>, <span class="literal">false</span>);</span><br><span class="line">    <span class="keyword">if</span> (!<span class="title function_ invoke__">is_array</span>(<span class="variable">$ATTACHMENTS</span>)) &#123;</span><br><span class="line">        <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">0</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="string">&#x27;-ERR &#x27;</span> . <span class="variable">$ATTACHMENTS</span>);</span><br><span class="line">        <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">        <span class="keyword">exit</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="title function_ invoke__">ob_end_clean</span>();</span><br><span class="line">    <span class="variable">$ATTACHMENT_ID</span> = <span class="title function_ invoke__">substr</span>(<span class="variable">$ATTACHMENTS</span>[<span class="string">&#x27;ID&#x27;</span>], <span class="number">0</span>, -<span class="number">1</span>);</span><br><span class="line">    <span class="variable">$ATTACHMENT_NAME</span> = <span class="title function_ invoke__">substr</span>(<span class="variable">$ATTACHMENTS</span>[<span class="string">&#x27;NAME&#x27;</span>], <span class="number">0</span>, -<span class="number">1</span>);</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$TYPE</span> == <span class="string">&#x27;mobile&#x27;</span>) &#123;</span><br><span class="line">        <span class="variable">$ATTACHMENT_NAME</span> = <span class="title function_ invoke__">td_iconv</span>(<span class="title function_ invoke__">urldecode</span>(<span class="variable">$ATTACHMENT_NAME</span>), <span class="string">&#x27;utf-8&#x27;</span>, MYOA_CHARSET);</span><br><span class="line">    &#125;</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;</span><br><span class="line">    <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">0</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;ÎÞÎÄ¼þÉÏ´«&#x27;</span>));</span><br><span class="line">    <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">    <span class="keyword">exit</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="variable">$FILE_SIZE</span> = <span class="title function_ invoke__">attach_size</span>(<span class="variable">$ATTACHMENT_ID</span>, <span class="variable">$ATTACHMENT_NAME</span>, <span class="variable">$MODULE</span>);</span><br><span class="line"><span class="keyword">if</span> (!<span class="variable">$FILE_SIZE</span>) &#123;</span><br><span class="line">    <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">0</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;ÎÄ¼þÉÏ´«Ê§°Ü&#x27;</span>));</span><br><span class="line">    <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">    <span class="keyword">exit</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span> (<span class="variable">$UPLOAD_MODE</span> == <span class="string">&#x27;1&#x27;</span>) &#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="title function_ invoke__">is_thumbable</span>(<span class="variable">$ATTACHMENT_NAME</span>)) &#123;</span><br><span class="line">        <span class="variable">$FILE_PATH</span> = <span class="title function_ invoke__">attach_real_path</span>(<span class="variable">$ATTACHMENT_ID</span>, <span class="variable">$ATTACHMENT_NAME</span>, <span class="variable">$MODULE</span>);</span><br><span class="line">        <span class="variable">$THUMB_FILE_PATH</span> = <span class="title function_ invoke__">substr</span>(<span class="variable">$FILE_PATH</span>, <span class="number">0</span>, <span class="title function_ invoke__">strlen</span>(<span class="variable">$FILE_PATH</span>) - <span class="title function_ invoke__">strlen</span>(<span class="variable">$ATTACHMENT_NAME</span>)) . <span class="string">&#x27;thumb_&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span>;</span><br><span class="line">        <span class="title function_ invoke__">CreateThumb</span>(<span class="variable">$FILE_PATH</span>, <span class="number">320</span>, <span class="number">240</span>, <span class="variable">$THUMB_FILE_PATH</span>);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="variable">$P_VER</span> = <span class="title function_ invoke__">is_numeric</span>(<span class="variable">$P_VER</span>) ? <span class="title function_ invoke__">intval</span>(<span class="variable">$P_VER</span>) : <span class="number">0</span>;</span><br><span class="line">    <span class="variable">$MSG_CATE</span> = <span class="variable">$_POST</span>[<span class="string">&#x27;MSG_CATE&#x27;</span>];</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$MSG_CATE</span> == <span class="string">&#x27;file&#x27;</span>) &#123;</span><br><span class="line">        <span class="variable">$CONTENT</span> = <span class="string">&#x27;[fm]&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$FILE_SIZE</span> . <span class="string">&#x27;[/fm]&#x27;</span>;</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable">$MSG_CATE</span> == <span class="string">&#x27;image&#x27;</span>) &#123;</span><br><span class="line">            <span class="variable">$CONTENT</span> = <span class="string">&#x27;[im]&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$FILE_SIZE</span> . <span class="string">&#x27;[/im]&#x27;</span>;</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="variable">$DURATION</span> = <span class="title function_ invoke__">intval</span>(<span class="variable">$DURATION</span>);</span><br><span class="line">            <span class="variable">$CONTENT</span> = <span class="string">&#x27;[vm]&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$DURATION</span> . <span class="string">&#x27;[/vm]&#x27;</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="variable">$AID</span> = <span class="number">0</span>;</span><br><span class="line">    <span class="variable">$POS</span> = <span class="title function_ invoke__">strpos</span>(<span class="variable">$ATTACHMENT_ID</span>, <span class="string">&#x27;@&#x27;</span>);</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$POS</span> !== <span class="literal">false</span>) &#123;</span><br><span class="line">        <span class="variable">$AID</span> = <span class="title function_ invoke__">intval</span>(<span class="title function_ invoke__">substr</span>(<span class="variable">$ATTACHMENT_ID</span>, <span class="number">0</span>, <span class="variable">$POS</span>));</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="variable">$query</span> = <span class="string">&#x27;INSERT INTO im_offline_file (TIME,SRC_UID,DEST_UID,FILE_NAME,FILE_SIZE,FLAG,AID) values (\&#x27;&#x27;</span> . <span class="title function_ invoke__">date</span>(<span class="string">&#x27;Y-m-d H:i:s&#x27;</span>) . <span class="string">&#x27;\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$_SESSION</span>[<span class="string">&#x27;LOGIN_UID&#x27;</span>] . <span class="string">&#x27;\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$DEST_UID</span> . <span class="string">&#x27;\&#x27;,\&#x27;*&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;.&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$FILE_SIZE</span> . <span class="string">&#x27;\&#x27;,\&#x27;0\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$AID</span> . <span class="string">&#x27;\&#x27;)&#x27;</span>;</span><br><span class="line">    <span class="variable">$cursor</span> = <span class="title function_ invoke__">exequery</span>(TD::<span class="title function_ invoke__">conn</span>(), <span class="variable">$query</span>);</span><br><span class="line">    <span class="variable">$FILE_ID</span> = <span class="title function_ invoke__">mysql_insert_id</span>();</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$cursor</span> === <span class="literal">false</span>) &#123;</span><br><span class="line">        <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">0</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;Êý¾Ý¿â²Ù×÷Ê§°Ü&#x27;</span>));</span><br><span class="line">        <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">        <span class="keyword">exit</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="variable">$dataBack</span> = <span class="keyword">array</span>(<span class="string">&#x27;status&#x27;</span> =&gt; <span class="number">1</span>, <span class="string">&#x27;content&#x27;</span> =&gt; <span class="variable">$CONTENT</span>, <span class="string">&#x27;file_id&#x27;</span> =&gt; <span class="variable">$FILE_ID</span>);</span><br><span class="line">    <span class="keyword">echo</span> <span class="title function_ invoke__">json_encode</span>(<span class="title function_ invoke__">data2utf8</span>(<span class="variable">$dataBack</span>));</span><br><span class="line">    <span class="keyword">exit</span>;</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="variable">$UPLOAD_MODE</span> == <span class="string">&#x27;2&#x27;</span>) &#123;</span><br><span class="line">        <span class="variable">$DURATION</span> = <span class="title function_ invoke__">intval</span>(<span class="variable">$_POST</span>[<span class="string">&#x27;DURATION&#x27;</span>]);</span><br><span class="line">        <span class="variable">$CONTENT</span> = <span class="string">&#x27;[vm]&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$DURATION</span> . <span class="string">&#x27;[/vm]&#x27;</span>;</span><br><span class="line">        <span class="variable">$query</span> = <span class="string">&#x27;INSERT INTO WEIXUN_SHARE (UID, CONTENT, ADDTIME) VALUES (\&#x27;&#x27;</span> . <span class="variable">$_SESSION</span>[<span class="string">&#x27;LOGIN_UID&#x27;</span>] . <span class="string">&#x27;\&#x27;, \&#x27;&#x27;</span> . <span class="variable">$CONTENT</span> . <span class="string">&#x27;\&#x27;, \&#x27;&#x27;</span> . <span class="title function_ invoke__">time</span>() . <span class="string">&#x27;\&#x27;)&#x27;</span>;</span><br><span class="line">        <span class="variable">$cursor</span> = <span class="title function_ invoke__">exequery</span>(TD::<span class="title function_ invoke__">conn</span>(), <span class="variable">$query</span>);</span><br><span class="line">        <span class="keyword">echo</span> <span class="string">&#x27;+OK &#x27;</span> . <span class="variable">$CONTENT</span>;</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable">$UPLOAD_MODE</span> == <span class="string">&#x27;3&#x27;</span>) &#123;</span><br><span class="line">            <span class="keyword">if</span> (<span class="title function_ invoke__">is_thumbable</span>(<span class="variable">$ATTACHMENT_NAME</span>)) &#123;</span><br><span class="line">                <span class="variable">$FILE_PATH</span> = <span class="title function_ invoke__">attach_real_path</span>(<span class="variable">$ATTACHMENT_ID</span>, <span class="variable">$ATTACHMENT_NAME</span>, <span class="variable">$MODULE</span>);</span><br><span class="line">                <span class="variable">$THUMB_FILE_PATH</span> = <span class="title function_ invoke__">substr</span>(<span class="variable">$FILE_PATH</span>, <span class="number">0</span>, <span class="title function_ invoke__">strlen</span>(<span class="variable">$FILE_PATH</span>) - <span class="title function_ invoke__">strlen</span>(<span class="variable">$ATTACHMENT_NAME</span>)) . <span class="string">&#x27;thumb_&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span>;</span><br><span class="line">                <span class="title function_ invoke__">CreateThumb</span>(<span class="variable">$FILE_PATH</span>, <span class="number">320</span>, <span class="number">240</span>, <span class="variable">$THUMB_FILE_PATH</span>);</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">echo</span> <span class="string">&#x27;+OK &#x27;</span> . <span class="variable">$ATTACHMENT_ID</span>;</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="variable">$CONTENT</span> = <span class="string">&#x27;[fm]&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;|&#x27;</span> . <span class="variable">$FILE_SIZE</span> . <span class="string">&#x27;[/fm]&#x27;</span>;</span><br><span class="line">            <span class="variable">$msg_id</span> = <span class="title function_ invoke__">send_msg</span>(<span class="variable">$_SESSION</span>[<span class="string">&#x27;LOGIN_UID&#x27;</span>], <span class="variable">$DEST_UID</span>, <span class="number">1</span>, <span class="variable">$CONTENT</span>, <span class="string">&#x27;&#x27;</span>, <span class="number">2</span>);</span><br><span class="line">            <span class="variable">$query</span> = <span class="string">&#x27;insert into IM_OFFLINE_FILE (TIME,SRC_UID,DEST_UID,FILE_NAME,FILE_SIZE,FLAG) values (\&#x27;&#x27;</span> . <span class="title function_ invoke__">date</span>(<span class="string">&#x27;Y-m-d H:i:s&#x27;</span>) . <span class="string">&#x27;\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$_SESSION</span>[<span class="string">&#x27;LOGIN_UID&#x27;</span>] . <span class="string">&#x27;\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$DEST_UID</span> . <span class="string">&#x27;\&#x27;,\&#x27;*&#x27;</span> . <span class="variable">$ATTACHMENT_ID</span> . <span class="string">&#x27;.&#x27;</span> . <span class="variable">$ATTACHMENT_NAME</span> . <span class="string">&#x27;\&#x27;,\&#x27;&#x27;</span> . <span class="variable">$FILE_SIZE</span> . <span class="string">&#x27;\&#x27;,\&#x27;0\&#x27;)&#x27;</span>;</span><br><span class="line">            <span class="variable">$cursor</span> = <span class="title function_ invoke__">exequery</span>(TD::<span class="title function_ invoke__">conn</span>(), <span class="variable">$query</span>);</span><br><span class="line">            <span class="variable">$FILE_ID</span> = <span class="title function_ invoke__">mysql_insert_id</span>();</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable">$cursor</span> === <span class="literal">false</span>) &#123;</span><br><span class="line">                <span class="keyword">echo</span> <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;Êý¾Ý¿â²Ù×÷Ê§°Ü&#x27;</span>);</span><br><span class="line">                <span class="keyword">exit</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable">$FILE_ID</span> == <span class="number">0</span>) &#123;</span><br><span class="line">                <span class="keyword">echo</span> <span class="string">&#x27;-ERR &#x27;</span> . <span class="title function_ invoke__">_</span>(<span class="string">&#x27;Êý¾Ý¿â²Ù×÷Ê§°Ü2&#x27;</span>);</span><br><span class="line">                <span class="keyword">exit</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">echo</span> <span class="string">&#x27;+OK ,&#x27;</span> . <span class="variable">$FILE_ID</span> . <span class="string">&#x27;,&#x27;</span> . <span class="variable">$msg_id</span>;</span><br><span class="line">            <span class="keyword">exit</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>看下开头这一块，就是绕过的核心部分</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">set_time_limit(0);</span><br><span class="line">$P = $_POST[&#x27;P&#x27;];</span><br><span class="line">if (isset($P) || $P != &#x27;&#x27;) &#123;</span><br><span class="line">    ob_start();</span><br><span class="line">    include_once &#x27;inc/session.php&#x27;;</span><br><span class="line">    session_id($P);</span><br><span class="line">    session_start();</span><br><span class="line">    session_write_close();</span><br><span class="line">&#125; else &#123;</span><br><span class="line">    include_once &#x27;./auth.php&#x27;;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>这里获取了一个P，如果P存在或者不为空，就要包含上面的auth.php，看名字就知道是一个主要实现身份认证功能，所以通过这里的参数”P”绕过登录认证，就可以去下面的上传了</li>
<li>在往后就是两个IF条件句，只要进去了都要exit退出，所以要绕过才能进入上传的逻辑里面</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$DEST_UID = $_POST[&#x27;DEST_UID&#x27;];</span><br><span class="line">还好这个参数可控，要求不能为 0 也不能为空就可以了</span><br></pre></td></tr></table></figure>

<p><img src="https://img-blog.csdnimg.cn/20200403094623450.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<ul>
<li>进入循环后使用PHP的 $_FILES 函数来获取我们上传的文件信息</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$_FILES[&#x27;ATTACHMENT&#x27;][&#x27;name&#x27;]</span><br></pre></td></tr></table></figure>

<ul>
<li>第一个下标必须是我们的input name值，因此我们的POST包的Content-Disposition: form-data; name&#x3D;“ATTACHMENT”; filename&#x3D;”xxx.php.png”中的name必须是’ATTACHMENT’。</li>
<li>也就是有文件上传就会调用upload函数</li>
<li>后续对获取的文件名处理了一下，对获取的文件名行一次url解码，对比文件名长度是否有变化，如果有变化，则将url解码后的文件名作为最后的文件名</li>
<li>在45行有upload函数，要跟进看一下干了什么，inc&#x2F;utility_file.php的1321行</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ATTACHMENTS = upload(&#x27;ATTACHMENT&#x27;, $MODULE, false);</span><br></pre></td></tr></table></figure>

<p>函数具体代码如下：</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">upload</span>(<span class="params"><span class="variable">$PREFIX</span> = <span class="string">&#x27;ATTACHMENT&#x27;</span>, <span class="variable">$MODULE</span> = <span class="string">&#x27;&#x27;</span>, <span class="variable">$OUTPUT</span> = <span class="literal">true</span></span>)</span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (<span class="title function_ invoke__">strstr</span>(<span class="variable">$MODULE</span>, <span class="string">&#x27;/&#x27;</span>) || <span class="title function_ invoke__">strstr</span>(<span class="variable">$MODULE</span>, <span class="string">&#x27;\\&#x27;</span>)) &#123;</span><br><span class="line">        <span class="keyword">if</span> (!<span class="variable">$OUTPUT</span>) &#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="title function_ invoke__">_</span>(<span class="string">&#x27;参数含有非法字符。&#x27;</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="title function_ invoke__">Message</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;错误&#x27;</span>), <span class="title function_ invoke__">_</span>(<span class="string">&#x27;参数含有非法字符。&#x27;</span>));</span><br><span class="line">        <span class="keyword">exit</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="variable">$ATTACHMENTS</span> = <span class="keyword">array</span>(<span class="string">&#x27;ID&#x27;</span> =&gt; <span class="string">&#x27;&#x27;</span>, <span class="string">&#x27;NAME&#x27;</span> =&gt; <span class="string">&#x27;&#x27;</span>);</span><br><span class="line">    <span class="title function_ invoke__">reset</span>(<span class="variable">$_FILES</span>);</span><br><span class="line">    <span class="keyword">foreach</span> (<span class="variable">$_FILES</span> <span class="keyword">as</span> <span class="variable">$KEY</span> =&gt; <span class="variable">$ATTACHMENT</span>) &#123;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable">$ATTACHMENT</span>[<span class="string">&#x27;error&#x27;</span>] == <span class="number">4</span> || <span class="variable">$KEY</span> != <span class="variable">$PREFIX</span> &amp;&amp; <span class="title function_ invoke__">substr</span>(<span class="variable">$KEY</span>, <span class="number">0</span>, <span class="title function_ invoke__">strlen</span>(<span class="variable">$PREFIX</span>) + <span class="number">1</span>) != <span class="variable">$PREFIX</span> . <span class="string">&#x27;_&#x27;</span>) &#123;</span><br><span class="line">            <span class="keyword">continue</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="variable">$data_charset</span> = <span class="keyword">isset</span>(<span class="variable">$_GET</span>[<span class="string">&#x27;data_charset&#x27;</span>]) ? <span class="variable">$_GET</span>[<span class="string">&#x27;data_charset&#x27;</span>] : (<span class="keyword">isset</span>(<span class="variable">$_POST</span>[<span class="string">&#x27;data_charset&#x27;</span>]) ? <span class="variable">$_POST</span>[<span class="string">&#x27;data_charset&#x27;</span>] : <span class="string">&#x27;&#x27;</span>);</span><br><span class="line">        <span class="variable">$ATTACH_NAME</span> = <span class="variable">$data_charset</span> != <span class="string">&#x27;&#x27;</span> ? <span class="title function_ invoke__">td_iconv</span>(<span class="variable">$ATTACHMENT</span>[<span class="string">&#x27;name&#x27;</span>], <span class="variable">$data_charset</span>, MYOA_CHARSET) : <span class="variable">$ATTACHMENT</span>[<span class="string">&#x27;name&#x27;</span>];</span><br><span class="line">        <span class="variable">$ATTACH_SIZE</span> = <span class="variable">$ATTACHMENT</span>[<span class="string">&#x27;size&#x27;</span>];</span><br><span class="line">        <span class="variable">$ATTACH_ERROR</span> = <span class="variable">$ATTACHMENT</span>[<span class="string">&#x27;error&#x27;</span>];</span><br><span class="line">        <span class="variable">$ATTACH_FILE</span> = <span class="variable">$ATTACHMENT</span>[<span class="string">&#x27;tmp_name&#x27;</span>];</span><br><span class="line">        <span class="variable">$ERROR_DESC</span> = <span class="string">&#x27;&#x27;</span>;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable">$ATTACH_ERROR</span> == UPLOAD_ERR_OK) &#123;</span><br><span class="line">            <span class="keyword">if</span> (!<span class="title function_ invoke__">is_uploadable</span>(<span class="variable">$ATTACH_NAME</span>)) &#123;</span><br><span class="line">                <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;禁止上传后缀名为[%s]的文件&#x27;</span>), <span class="title function_ invoke__">substr</span>(<span class="variable">$ATTACH_NAME</span>, <span class="title function_ invoke__">strrpos</span>(<span class="variable">$ATTACH_NAME</span>, <span class="string">&#x27;.&#x27;</span>) + <span class="number">1</span>));</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="variable">$encode</span> = <span class="title function_ invoke__">mb_detect_encoding</span>(<span class="variable">$ATTACH_NAME</span>, <span class="keyword">array</span>(<span class="string">&#x27;ASCII&#x27;</span>, <span class="string">&#x27;UTF-8&#x27;</span>, <span class="string">&#x27;GB2312&#x27;</span>, <span class="string">&#x27;GBK&#x27;</span>, <span class="string">&#x27;BIG5&#x27;</span>));</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable">$encode</span> != <span class="string">&#x27;UTF-8&#x27;</span>) &#123;</span><br><span class="line">                <span class="variable">$ATTACH_NAME_UTF8</span> = <span class="title function_ invoke__">mb_convert_encoding</span>(<span class="variable">$ATTACH_NAME</span>, <span class="string">&#x27;utf-8&#x27;</span>, MYOA_CHARSET);</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                <span class="variable">$ATTACH_NAME_UTF8</span> = <span class="variable">$ATTACH_NAME</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span> (<span class="title function_ invoke__">preg_match</span>(<span class="string">&#x27;/[\\\&#x27;:&lt;&gt;?]|\\/|\\\\|&quot;|\\|/u&#x27;</span>, <span class="variable">$ATTACH_NAME_UTF8</span>)) &#123;</span><br><span class="line">                <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件名[%s]包含[/\\\&#x27;&quot;:*?&lt;&gt;|]等非法字符&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable">$ATTACH_SIZE</span> == <span class="number">0</span>) &#123;</span><br><span class="line">                <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]大小为0字节&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable">$ERROR_DESC</span> == <span class="string">&#x27;&#x27;</span>) &#123;</span><br><span class="line">                <span class="variable">$ATTACH_NAME</span> = <span class="title function_ invoke__">str_replace</span>(<span class="string">&#x27;\&#x27;&#x27;</span>, <span class="string">&#x27;&#x27;</span>, <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">                <span class="variable">$ATTACH_ID</span> = <span class="title function_ invoke__">add_attach</span>(<span class="variable">$ATTACH_FILE</span>, <span class="variable">$ATTACH_NAME</span>, <span class="variable">$MODULE</span>);</span><br><span class="line">                <span class="keyword">if</span> (<span class="variable">$ATTACH_ID</span> === <span class="literal">false</span>) &#123;</span><br><span class="line">                    <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]上传失败&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">                &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                    <span class="variable">$ATTACHMENTS</span>[<span class="string">&#x27;ID&#x27;</span>] .= <span class="variable">$ATTACH_ID</span> . <span class="string">&#x27;,&#x27;</span>;</span><br><span class="line">                    <span class="variable">$ATTACHMENTS</span>[<span class="string">&#x27;NAME&#x27;</span>] .= <span class="variable">$ATTACH_NAME</span> . <span class="string">&#x27;*&#x27;</span>;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            @<span class="title function_ invoke__">unlink</span>(<span class="variable">$ATTACH_FILE</span>);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable">$ATTACH_ERROR</span> == UPLOAD_ERR_INI_SIZE) &#123;</span><br><span class="line">                <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]的大小超过了系统限制（%s）&#x27;</span>), <span class="variable">$ATTACH_NAME</span>, <span class="title function_ invoke__">ini_get</span>(<span class="string">&#x27;upload_max_filesize&#x27;</span>));</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                <span class="keyword">if</span> (<span class="variable">$ATTACH_ERROR</span> == UPLOAD_ERR_FORM_SIZE) &#123;</span><br><span class="line">                    <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]的大小超过了表单限制&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">                &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                    <span class="keyword">if</span> (<span class="variable">$ATTACH_ERROR</span> == UPLOAD_ERR_PARTIAL) &#123;</span><br><span class="line">                        <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]上传不完整&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">                    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                        <span class="keyword">if</span> (<span class="variable">$ATTACH_ERROR</span> == UPLOAD_ERR_NO_TMP_DIR) &#123;</span><br><span class="line">                            <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]上传失败：找不到临时文件夹&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">                        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                            <span class="keyword">if</span> (<span class="variable">$ATTACH_ERROR</span> == UPLOAD_ERR_CANT_WRITE) &#123;</span><br><span class="line">                                <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;文件[%s]写入失败&#x27;</span>), <span class="variable">$ATTACH_NAME</span>);</span><br><span class="line">                            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                                <span class="variable">$ERROR_DESC</span> = <span class="title function_ invoke__">sprintf</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;未知错误[代码：%s]&#x27;</span>), <span class="variable">$ATTACH_ERROR</span>);</span><br><span class="line">                            &#125;</span><br><span class="line">                        &#125;</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable">$ERROR_DESC</span> != <span class="string">&#x27;&#x27;</span>) &#123;</span><br><span class="line">            <span class="keyword">if</span> (!<span class="variable">$OUTPUT</span>) &#123;</span><br><span class="line">                <span class="title function_ invoke__">delete_attach</span>(<span class="variable">$ATTACHMENTS</span>[<span class="string">&#x27;ID&#x27;</span>], <span class="variable">$ATTACHMENTS</span>[<span class="string">&#x27;NAME&#x27;</span>], <span class="variable">$MODULE</span>);</span><br><span class="line">                <span class="keyword">return</span> <span class="variable">$ERROR_DESC</span>;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                <span class="title function_ invoke__">Message</span>(<span class="title function_ invoke__">_</span>(<span class="string">&#x27;错误&#x27;</span>), <span class="variable">$ERROR_DESC</span>);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="variable">$ATTACHMENTS</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>看下is_uploadable()函数对文件名进行检查，跟进到该函数，同样位于inc&#x2F;utility_file.php</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200330095139194.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<ul>
<li>这个仔细看一下，代码意思是查找 “.” 在文件名中最后一次出现的位置然后</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">strtolower(substr($FILE_NAME, $POS + 1, 3)) == &#x27;php&#x27;</span><br></pre></td></tr></table></figure>

<ul>
<li>这是 substr( 文件名,最后一次点的位置+1,3个位置)</li>
<li>从存在 ”.“ 开始匹配3位，判断后缀是否为php，,如果为php则返回false,否则将”.”之前的作为EXT_NAME。</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200330095216717.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<ul>
<li>这么判断 .php肯定是不行了，只能是 shell.php. 或者 shell.php.png</li>
<li>那么只能是配合文件包含漏洞了</li>
</ul>
<h2 id="变量传递问题"><a href="#变量传递问题" class="headerlink" title="变量传递问题"></a>变量传递问题</h2><ul>
<li><p>由于在upload.php中UPLOAD_MODE值的是一个重要的流程走向的判断</p>
</li>
<li><p>但是并没有发现是从哪来的，所以一直很疑惑，</p>
</li>
<li><p>但根据payload中POST的UPLOAD_MODE值可以被正常带入且影响文件上传走向</p>
</li>
<li><p>预测 UPLOAD_MODE值的方法存在于被包含的文件中,</p>
</li>
<li><p>但是UPLOAD_MODE这个参数名仅存在于upload.php中</p>
</li>
<li><p>开始追溯，发现下面的路径</p>
</li>
<li><p>具体调用为upload.php -&gt; session.php -&gt; coon.php -&gt; td_config.php -&gt; common.inc.php</p>
</li>
</ul>
<p>关键部分</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">if (0 &lt; count($_POST)) &#123;</span><br><span class="line">    $arr_html_fields = array();</span><br><span class="line">    foreach ($_POST as $s_key =&gt; $s_value) &#123;</span><br><span class="line">        if (substr($s_key, 0, 7) == &#x27;_SERVER&#x27;) &#123;</span><br><span class="line">            continue;</span><br><span class="line">        &#125;</span><br><span class="line">        if (substr($s_key, 0, 15) != &#x27;TD_HTML_EDITOR_&#x27;) &#123;</span><br><span class="line">            if (!is_array($s_value)) &#123;</span><br><span class="line">                $_POST[$s_key] = addslashes(strip_tags($s_value));</span><br><span class="line">            &#125;</span><br><span class="line">            $&#123;$s_key&#125; = $_POST[$s_key];</span><br><span class="line">        &#125; else &#123;</span><br><span class="line">            if ($s_key == &#x27;TD_HTML_EDITOR_FORM_HTML_DATA&#x27; || $s_key == &#x27;TD_HTML_EDITOR_PRCS_IN&#x27; || $s_key == &#x27;TD_HTML_EDITOR_PRCS_OUT&#x27; || $s_key == &#x27;TD_HTML_EDITOR_QTPL_PRCS_SET&#x27; || isset($_POST[&#x27;ACTION_TYPE&#x27;]) &amp;&amp; ($_POST[&#x27;ACTION_TYPE&#x27;] == &#x27;approve_center&#x27; || $_POST[&#x27;ACTION_TYPE&#x27;] == &#x27;workflow&#x27; || $_POST[&#x27;ACTION_TYPE&#x27;] == &#x27;sms&#x27; || $_POST[&#x27;ACTION_TYPE&#x27;] == &#x27;wiki&#x27;) &amp;&amp; ($s_key == &#x27;CONTENT&#x27; || $s_key == &#x27;TD_HTML_EDITOR_CONTENT&#x27; || $s_key == &#x27;TD_HTML_EDITOR_TPT_CONTENT&#x27;)) &#123;</span><br><span class="line">                unset($_POST[$s_key]);</span><br><span class="line">                $s_key = $s_key == &#x27;CONTENT&#x27; ? $s_key : substr($s_key, 15);</span><br><span class="line">                $&#123;$s_key&#125; = addslashes($s_value);</span><br><span class="line">                $arr_html_fields[$s_key] = $&#123;$s_key&#125;;</span><br><span class="line">            &#125; else &#123;</span><br><span class="line">                $encoding = mb_detect_encoding($s_value, &#x27;GBK,UTF-8&#x27;);</span><br><span class="line">                unset($_POST[$s_key]);</span><br><span class="line">                $s_key = substr($s_key, 15);</span><br><span class="line">                $&#123;$s_key&#125; = addslashes(rich_text_clean($s_value, $encoding));</span><br><span class="line">                $arr_html_fields[$s_key] = $&#123;$s_key&#125;;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    reset($_POST);</span><br><span class="line">    $_POST = array_merge($_POST, $arr_html_fields);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>首先一开始对 P O S T 长 度 进 行 了 判 断 , 这 里 _POST长度进行了判断,这里 P​OST长度进行了判断,这里_POST实际是一个数组,接着使用foreach函数对数组进行遍历,</li>
<li>在这里$_POST数组中key为”UPLOAD_MODE”,value为”2”,那么根据配会到</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">if (substr($s_key, 0, 15) != &#x27;TD_HTML_EDITOR_&#x27;) &#123;</span><br><span class="line">            if (!is_array($s_value)) &#123;</span><br><span class="line">                $_POST[$s_key] = addslashes(strip_tags($s_value));</span><br><span class="line">            &#125;</span><br><span class="line">            </span><br><span class="line">            //直接来这</span><br><span class="line">            $&#123;$s_key&#125; = $_POST[$s_key];</span><br></pre></td></tr></table></figure>

<ul>
<li><p>最终数组键名UPLOAD_MODE成了了变量名,而他的对应键值成为了变量值</p>
</li>
<li><p>所以 upload.php 未直接接收UPLOAD_MODE值,而我们仍可以传递到这里</p>
</li>
<li><p>upload函数的中 调用 add_attach函数，设置$ATTACHMENTS[‘ID’]</p>
</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200330095243732.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dvZF96elo=,size_16,color_FFFFFF,t_70"></p>
<ul>
<li>再往后 继续跟进函数add_attach，函数同样位于inc&#x2F;utility_file.php文件下</li>
<li>找到了保存路径的方式</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">function add_attach($SOURCE_FILE, $ATTACH_NAME, $MODULE, $YM, $ATTACH_SIGN, $ATTACH_ID)</span><br><span class="line">&#123;</span><br><span class="line">    $ATTACH_PARA_ARRAY = TD::get_cache(&quot;SYS_ATTACH_PARA&quot;);</span><br><span class="line">    $ATTACH_POS_ACTIVE = $ATTACH_PARA_ARRAY[&quot;SYS_ATTACH_POS_ACTIVE&quot;];</span><br><span class="line">    $ATTACH_PATH_ACTIVE = $ATTACH_PARA_ARRAY[&quot;SYS_ATTACH_PATH_ACTIVE&quot;];</span><br><span class="line"></span><br><span class="line">    if (!file_exists($SOURCE_FILE)) &#123;</span><br><span class="line">        return false;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    if ($MODULE == &quot;&quot;) &#123;</span><br><span class="line">        $MODULE = attach_sub_dir();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    if ($YM == &quot;&quot;) &#123;</span><br><span class="line">        $YM = date(&quot;ym&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    $PATH = $ATTACH_PATH_ACTIVE . $MODULE;</span><br><span class="line">    if (!file_exists($PATH) || !is_dir($PATH)) &#123;</span><br><span class="line">        @mkdir($PATH, 448);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    $PATH = $PATH . &quot;/&quot; . $YM;</span><br><span class="line">    if (!file_exists($PATH) || !is_dir($PATH)) &#123;</span><br><span class="line">        @mkdir($PATH, 448);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    $ATTACH_NAME = (is_default_charset($ATTACH_NAME) ? $ATTACH_NAME : iconv(&quot;utf-8&quot;, MYOA_CHARSET, $ATTACH_NAME));</span><br><span class="line">    $EXT_NAME = substr($ATTACH_NAME, strrpos($ATTACH_NAME, &quot;.&quot;));</span><br><span class="line">    $ATTACH_NAME = str_replace($EXT_NAME, strtolower($EXT_NAME), $ATTACH_NAME);</span><br><span class="line">    $ATTACH_FILE = (MYOA_ATTACH_NAME_FORMAT ? md5($ATTACH_NAME) . &quot;.td&quot; : $ATTACH_NAME);</span><br><span class="line">    $ATTACH_ID = mt_rand();</span><br><span class="line">    $FILENAME = $PATH . &quot;/&quot; . $ATTACH_ID . &quot;.&quot; . $ATTACH_FILE;</span><br><span class="line"></span><br><span class="line">    if (file_exists($FILENAME)) &#123;</span><br><span class="line">        $ATTACH_ID = mt_rand();</span><br><span class="line">        $FILENAME = $PATH . &quot;/&quot; . $ATTACH_ID . &quot;.&quot; . $ATTACH_FILE;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    $AID = mysql_insert_id();</span><br><span class="line">    $ATTACH_ID_NEW = $AID . &quot;@&quot; . $YM . &quot;_&quot; . $ATTACH_ID;</span><br><span class="line">    return $ATTACH_ID_NEW;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li><p>可以看到返回值 A T T A C H I D N E W 有 三 部 分 组 成 ATTACH_ID_NEW有三部分组成 ATTACHI​DN​EW有三部分组成AID， Y M ， YM， YM，ATTACH_ID</p>
</li>
<li><p>其实UPLOAD_MODE值随便为1，2，3中的任意一个数字，都可以返回文件名字和部分路径，不看也行</p>
</li>
</ul>
<h2 id="文件包含部分"><a href="#文件包含部分" class="headerlink" title="文件包含部分"></a>文件包含部分</h2><ul>
<li>这个比较简单</li>
<li>文件包含功能的文件位于webroot\ispirit\interface\gateway.php</li>
<li>具体代码如下：</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">&lt;?php</span><br><span class="line">//decode by http://dezend.qiling.org  QQ 2859470</span><br><span class="line"></span><br><span class="line">ob_start();</span><br><span class="line">include_once &#x27;inc/session.php&#x27;;</span><br><span class="line">include_once &#x27;inc/conn.php&#x27;;</span><br><span class="line">include_once &#x27;inc/utility_org.php&#x27;;</span><br><span class="line">if ($P != &#x27;&#x27;) &#123;</span><br><span class="line">    if (preg_match(&#x27;/[^a-z0-9;]+/i&#x27;, $P)) &#123;</span><br><span class="line">        echo _(&#x27;非法参数&#x27;);</span><br><span class="line">        exit;</span><br><span class="line">    &#125;</span><br><span class="line">    session_id($P);</span><br><span class="line">    session_start();</span><br><span class="line">    session_write_close();</span><br><span class="line">    if ($_SESSION[&#x27;LOGIN_USER_ID&#x27;] == &#x27;&#x27; || $_SESSION[&#x27;LOGIN_UID&#x27;] == &#x27;&#x27;) &#123;</span><br><span class="line">        echo _(&#x27;RELOGIN&#x27;);</span><br><span class="line">        exit;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">if ($json) &#123;</span><br><span class="line">    $json = stripcslashes($json);</span><br><span class="line">    $json = (array) json_decode($json);</span><br><span class="line">    foreach ($json as $key =&gt; $val) &#123;</span><br><span class="line">        if ($key == &#x27;data&#x27;) &#123;</span><br><span class="line">            $val = (array) $val;</span><br><span class="line">            foreach ($val as $keys =&gt; $value) &#123;</span><br><span class="line">                $&#123;$keys&#125; = $value;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        if ($key == &#x27;url&#x27;) &#123;</span><br><span class="line">            $url = $val;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    if ($url != &#x27;&#x27;) &#123;</span><br><span class="line">        if (substr($url, 0, 1) == &#x27;/&#x27;) &#123;</span><br><span class="line">            $url = substr($url, 1);</span><br><span class="line">        &#125;</span><br><span class="line">        if (strpos($url, &#x27;general/&#x27;) !== false || strpos($url, &#x27;ispirit/&#x27;) !== false || strpos($url, &#x27;module/&#x27;) !== false) &#123;</span><br><span class="line">            include_once $url;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    exit;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li><p>这里的参数也是，POST直接传入就可以了，分析在上面也有主要是有这两个个就可以</p>
</li>
<li><p>&#96;&#96;&#96;<br>include_once ‘inc&#x2F;session.php’;<br>include_once ‘inc&#x2F;conn.php’;</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">- 逻辑较为简单，</span><br><span class="line"></span><br><span class="line">- 如果这里不传递参数P为空，就以绕过前面一系列的检测直</span><br><span class="line"></span><br><span class="line">- 随后从json中获取url参数的值</span><br><span class="line"></span><br><span class="line">- 只有 general/、ispirit/、module/ 在url内，在直接包含 \$url,</span><br><span class="line"></span><br><span class="line">- 文件包含结束</span><br><span class="line"></span><br><span class="line">构造一个就好了</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>&#x2F;ispirit&#x2F;interface&#x2F;gateway.php?json&#x3D;{“url”:”&#x2F;general&#x2F;..&#x2F;..&#x2F;attach&#x2F;im&#x2F;2003&#x2F;1153189608.jpg”}</p>
</li>
</ul>
<p>&#96;&#96;&#96;</p>
<p>0x03 修复方案</p>
<ul>
<li>更新官方发布的补丁 <a target="_blank" rel="noopener" href="http://www.tongda2000.com/news/673.php">http://www.tongda2000.com/news/673.php</a></li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://godzeo.github.io">Zeo</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://godzeo.github.io/2020/03/30/%E9%80%9A%E8%BE%BEOA%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0!%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%ABRCE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">https://godzeo.github.io/2020/03/30/%E9%80%9A%E8%BE%BEOA%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0!%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%ABRCE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://godzeo.github.io" target="_blank">Zeo's Security Lab</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1/">代码审计</a></div><div class="post_share"><div class="social-share" data-image="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225559.webp" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/04/06/%E8%AE%B0%E4%B8%80%E6%AC%A1360%E4%BC%97%E6%B5%8B%E4%BB%BF%E7%9C%9F%E5%AE%9E%E6%88%98%E9%9D%B6%E5%9C%BA%E8%80%83%E6%A0%B8WP/"><img class="prev-cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">记一次360众测仿真实战靶场考核WP</div></div></a></div><div class="next-post pull-right"><a href="/2020/03/22/%E6%B5%85%E8%B0%88SSRF%20%E5%8A%A0redis%E5%8F%8D%E5%BC%B9shell/"><img class="next-cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225559.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">浅谈SSRF 加redis反弹shell</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2019/12/20/phpStorm%E9%85%8D%E7%BD%AExdebug/" title="phpStorm配置xdebug"><img class="cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-20</div><div class="title">phpStorm配置xdebug</div></div></a></div><div><a href="/2020/03/18/%E9%80%9A%E8%BE%BEOA%E5%89%8D%E5%8F%B0RCE%E5%8A%A0EXP%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0+%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%AB/" title="通达OA前台RCE加EXP任意文件上传+文件包含"><img class="cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-03-18</div><div class="title">通达OA前台RCE加EXP任意文件上传+文件包含</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231013354.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Zeo</div><div class="author-info__description">专注于安全,分享生活,分享知识</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">125</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">46</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/godzeo"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/godzeo" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:zzzhhhaaaiiii@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">Weclome my blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%80%9A%E8%BE%BEOA%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0-x2F-%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%ABRCE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90"><span class="toc-number">1.</span> <span class="toc-text">通达OA任意文件上传&#x2F;文件包含RCE漏洞分析</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x01-%E5%89%8D%E6%8F%90"><span class="toc-number"></span> <span class="toc-text">0x01 前提</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x01-%E6%BC%8F%E6%B4%9E%E4%BB%8B%E7%BB%8D"><span class="toc-number"></span> <span class="toc-text">0x01 漏洞介绍</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x02-%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90"><span class="toc-number"></span> <span class="toc-text">0x02 漏洞分析</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A6%96%E5%85%88%E4%B8%8B%E8%BD%BD%E5%AE%89%E8%A3%85"><span class="toc-number"></span> <span class="toc-text">首先下载安装</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BB%95%E8%BF%87%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E9%83%A8%E5%88%86"><span class="toc-number"></span> <span class="toc-text">绕过身份验证文件上传部分</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%98%E9%87%8F%E4%BC%A0%E9%80%92%E9%97%AE%E9%A2%98"><span class="toc-number"></span> <span class="toc-text">变量传递问题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%AB%E9%83%A8%E5%88%86"><span class="toc-number"></span> <span class="toc-text">文件包含部分</span></a></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/11/28/Nosql%20inject%E6%B3%A8%E5%85%A5/" title="Nosql inject注入"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Nosql inject注入"/></a><div class="content"><a class="title" href="/2022/11/28/Nosql%20inject%E6%B3%A8%E5%85%A5/" title="Nosql inject注入">Nosql inject注入</a><time datetime="2022-11-28T07:28:02.000Z" title="发表于 2022-11-28 15:28:02">2022-11-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/11/15/%E4%BC%81%E4%B8%9A%20SDLC%20%E5%AE%89%E5%85%A8%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E7%AE%A1%E7%90%86/" title="企业 SDLC 安全生命周期管理"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="企业 SDLC 安全生命周期管理"/></a><div class="content"><a class="title" href="/2022/11/15/%E4%BC%81%E4%B8%9A%20SDLC%20%E5%AE%89%E5%85%A8%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E7%AE%A1%E7%90%86/" title="企业 SDLC 安全生命周期管理">企业 SDLC 安全生命周期管理</a><time datetime="2022-11-15T14:03:44.000Z" title="发表于 2022-11-15 22:03:44">2022-11-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/11/05/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E6%BC%8F%E6%B4%9E(File%20Operation!Redirect!Cors)/" title="Go 代码审计漏洞(File Operation\Redirect\Cors)"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 代码审计漏洞(File Operation\Redirect\Cors)"/></a><div class="content"><a class="title" href="/2022/11/05/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E6%BC%8F%E6%B4%9E(File%20Operation!Redirect!Cors)/" title="Go 代码审计漏洞(File Operation\Redirect\Cors)">Go 代码审计漏洞(File Operation\Redirect\Cors)</a><time datetime="2022-11-05T09:15:28.000Z" title="发表于 2022-11-05 17:15:28">2022-11-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/30/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E9%AB%98%E5%8D%B1%E6%BC%8F%E6%B4%9E(sqli!cmd!ssrf)/" title="Go 代码审计高危漏洞(sqli\cmd\ssrf)"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 代码审计高危漏洞(sqli\cmd\ssrf)"/></a><div class="content"><a class="title" href="/2022/10/30/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E9%AB%98%E5%8D%B1%E6%BC%8F%E6%B4%9E(sqli!cmd!ssrf)/" title="Go 代码审计高危漏洞(sqli\cmd\ssrf)">Go 代码审计高危漏洞(sqli\cmd\ssrf)</a><time datetime="2022-10-30T06:57:14.000Z" title="发表于 2022-10-30 14:57:14">2022-10-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/05/10/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%EF%BC%9A%20ClassLoader%E5%BA%94%E7%94%A8/" title="Java代码审计： ClassLoader应用"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java代码审计： ClassLoader应用"/></a><div class="content"><a class="title" href="/2022/05/10/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%EF%BC%9A%20ClassLoader%E5%BA%94%E7%94%A8/" title="Java代码审计： ClassLoader应用">Java代码审计： ClassLoader应用</a><time datetime="2022-05-10T08:21:21.000Z" title="发表于 2022-05-10 16:21:21">2022-05-10</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2022 By Zeo</div><div class="footer_custom_text">Hi, welcome to my blog!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div></div></body></html>